import {
  Controller,
  Get,
  Post,
  Body,
  Query,
  Header,
  UseGuards,
  Request,
} from '@nestjs/common';
import { MenuService } from './menu.service';
import { AuthGuard } from '@nestjs/passport';

// @UseGuards(AuthGuard('jwt'))
@Controller('menu')
export class MenuController {
  constructor(private readonly menuService: MenuService) {}
  
  @Get('/getMenuList')
  async getMenuList(@Query() param) {
    return await this.menuService.getMenuList(param);
  }
  @Post('/getMenuTreeList')
  async getMenuTreeList(@Body() param) {
    return await this.menuService.getMenuTreeList(param);
  }
  @Get('/getMenuTree')
  async getMenuTree(@Query() param) {
    return await this.menuService.getMenuTree(param);
  }
  @Get('/getMenu')
  async getMenu(@Query() param) {
    return await this.menuService.getMenu(param);
  }
  @Post('/saveMenu')
  async saveMenu(@Body() param) {
    return await this.menuService.saveMenu(param);
  }
    //批量删除角色
    @Post('/delMenuList')
    async delMenuList(@Body() param) {
      return await this.menuService.delMenuList(param);
    }
}
